import API from '@/common/apiurl'
import hdAjax from './hdAjax'
import router from '../../../router'
const isPhone = (callback) => {
  console.log('进入isphone了');
  // axios.get(API.myInfo)
  // .then(function (response) {
  //   if (response.data.result.mobile == null) {
  //     alert('未绑定手机')
  //     router.push({path: 'addLogin'})
  //   }
  // })
  // .catch(function (error) {
  //   console.log(error);
  //   return error.msg;
  // });
  hdAjax({
    url: API.myInfo,
    data: {
    },
    success: (resultData) => {
      if (typeof callback == 'function') {
        callback(resultData);
      }
      if (resultData.result.mobile == null) {
        alert('未绑定手机')
        router.push({path: '/appLogin', query: {redirect: router.currentRoute.fullPath}})
      }
    }
  });
}

export default isPhone
